﻿using Common.Device.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Device.DeviceDb
{
    [SugarTable("AllDevice")]
    public class AllDevice
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int id { get; set; }
        /// <summary>
        /// 仪器
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceTempEnum temp { get; set; }
        /// <summary>
        /// 仪器类型
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceTypeEnum type { get; set; }
        /// <summary>
        /// 仪器型号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceModelEnum model { get; set; }

        /// <summary>
        /// 通信方式
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)",IsJson =true)] 
        public List<DeviceEnum.DeviceModeEnum> mode { get; set; }
        /// <summary>
        /// 仪器描述
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(1000)", IsNullable = true)]
        public string descripe { get; set; }
    }
}
